package test06;

/**
 * 性能指标类
 */
public class PerformanceMetrics {
    private double latency;
    private double throughput;
    private double memoryUsage;

    public void updateMetrics(double latency, double throughput, double memoryUsage) {
        this.latency = latency;
        this.throughput = throughput;
        this.memoryUsage = memoryUsage;
    }

    // Getters
    public double getLatency() { return latency; }
    public double getThroughput() { return throughput; }
    public double getMemoryUsage() { return memoryUsage; }

    @Override
    public String toString() {
        return String.format("性能指标: 延迟=%.2fms, 吞吐量=%.2f req/s, 内存使用=%.2fMB",
                latency, throughput, memoryUsage);
    }
}
